<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //ES6允许按照一定的模式从数组中提取值，对变量进行赋值
        //这个被称之为解构赋值
        //1.数组的结构
        const F4 = ['张三', '李四', '王五', '尚硅谷'];
        let [zhang, li, wang, shang] = F4;
        console.log(zhang);
        console.log(li);
        console.log(wang);
        console.log(shang);

        console.log('----------------');
        //2.对象的结构
        const zhao = {
            name: '赵本山',
            age: '不详',
            xiaopin: function () {
                console.log('我可以演小品');
            }
        };
        let { name, age, xiaopin } = zhao
        console.log(name);
        console.log(age);
        console.log(xiaopin);
        console.log('----------------');
        // xiaopin();
    </script>
</body>

</html>